/* eslint-disable react/destructuring-assignment */
import React, { PureComponent } from 'react';
import moment from 'moment';
import router from 'umi/router';
import queryString from 'query-string';
import { Card, Button } from 'antd';
import { connect } from 'dva';
import PageHeaderWrapper from '@/components/PageHeaderWrapper'; // 引入头部组件
import DescriptionList from '@/components/DescriptionList';
import FooterToolbar from '@/components/FooterToolbar';

const { Description } = DescriptionList;

@connect(({ supplieraccountmanage }) => ({
  supplieraccountmanage,
}))
class BasicList extends PureComponent {
  componentDidMount() {
    const { location, dispatch } = this.props;
    const suppUserId = queryString.parse(location.search).suppUserId || '';
    dispatch({
      type: 'supplieraccountmanage/queryAccountById',
      payload: { suppUserId },
    });
  }

  render() {
    const {
      supplieraccountmanage: { detailFormValue },
    } = this.props;
    return (
      <PageHeaderWrapper>
        <Card>
          <div>
            <p style={{ fontWeight: '900', fontSize: '14px' }}>供应商信息</p>
            <DescriptionList>
              {/* <Description term="供应商名称">成都百名房产有限公司</Description>
                            <Description term="使用系统端口">供应商端</Description>
                            <Description term="创建时间">2018-10-20</Description>

                            <Description term="邮箱">xiexiejiaxin@163.com</Description>
                            <Description term="联系电话">18132031142</Description>
                            <Description term="备注">跨国公司</Description> */}
              <Description term="供应商名称">{detailFormValue.suppName || '--'}</Description>
              <Description term="使用系统端口">{detailFormValue.sysPortName || '--'}</Description>
              <Description term="登录账号">{detailFormValue.loginName || '--'}</Description>
              <Description term="密码">******</Description>
              <Description term="负责人">{detailFormValue.manager || '--'}</Description>
              <Description term="联系电话">{detailFormValue.phone || '--'}</Description>
              <Description term="邮箱">{detailFormValue.email || '--'}</Description>

              <Description term="备注">{detailFormValue.remark || '--'}</Description>
              <Description term="创建时间">
                {moment(detailFormValue.creTime).format('YYYY-MM-DD HH:mm') || '--'}
              </Description>
            </DescriptionList>
          </div>
        </Card>
        <FooterToolbar style={{ width: '100%' }}>
          <Button onClick={() => router.goBack()}>返回</Button>
        </FooterToolbar>
      </PageHeaderWrapper>
    );
  }
}
export default BasicList;
